/* -------------------------------Noble Steed Engine -----------------------------*
Authors : Daniel Randle, Alex Bourne
Date Created : Mar 10 2013

File:
	nsmaterial.h

Description:
	This file contains the declaration for the NSMaterial class along with any
	helper functions associated with the class
*-----------------------------------------------------------------------------*/

#ifndef NSMATERIAL_H
#define NSMATERIAL_H
#define TEXMAPTYPES 11

// Inlcudes
#include <vector>
#include <nstexture.h>


/*----------------------------Class NSMaterial----------------------------------*
Description:
	This class encompasses loading materials which contain multiple textures
	from file - things such as diffuse, specular, height, and normal maps
	will all be saved in a material for easy access and use
*-----------------------------------------------------------------------------*/

class NSMaterial
{
public:
	NSMaterial(NSTexture * diffuseMap=NULL, 
		NSTexture *  normalMap=NULL,  
		NSTexture *  specularMap=NULL,  
		NSTexture *  displacementMap=NULL,  
		NSTexture *  heightMap=NULL,  
		NSTexture *  ambientMap=NULL,  
		NSTexture *  emissiveMap=NULL,  
		NSTexture *  shininessMap=NULL,  
		NSTexture *  opacityMap=NULL,  
		NSTexture *  lightMap=NULL,  
		NSTexture *  reflectionMap=NULL);

	~NSMaterial();

	void disableAllValidTextures();
	void disableTexture(NSTexture::MapType mapType);

	NSTexture * getTexture(NSTexture::MapType mapType);

	bool isAlphaBlend();

	bool loadTextureFromFile(const std::string & fileName, 
		const std::string & textureDir,
		NSTexture::MapType mapType,
		bool mipmap = true, 
		NSTexture::TexType type = NSTexture::Tex2D);

	void setAlphaBlend(bool set);
	bool setTexture(NSTexture::MapType mapType, 
		NSTexture * texture, 
		bool overwrite = false);

	void useAllValidTextures();
	void useTexture(NSTexture::MapType mapType);

private:
	bool alphaBlend;
	std::vector<NSTexture*> textures;
	const unsigned int TextureMapTypes;
};


#endif